longest repeating character replacement